package com.chujiekeji.test.adapter.friend;

import android.content.Context;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chujiekeji.test.R;
import com.chujiekeji.test.adapter.BaseRecyclerAdapter;
import com.chujiekeji.test.bean.friend.FenSi;

import butterknife.BindView;
import butterknife.ButterKnife;

public class FenSiAdapter extends BaseRecyclerAdapter<FenSi> {

    public FenSiAdapter(Context context, int mode) {
        super(context, mode);
    }

    @Override
    protected RecyclerView.ViewHolder onCreateDefaultViewHolder(ViewGroup parent, int type) {
        return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_list_guanzhu, parent, false));

    }

    @Override
    protected void onBindDefaultViewHolder(RecyclerView.ViewHolder h, FenSi item, int position) {
        ViewHolder holder = (ViewHolder) h;
        holder.mainImageView.setImageResource(R.mipmap.ic_default_avatar_circle);
        holder.nameTextView.setText(item.getNickName());
    }
    public static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.mainLinearLayout)
        LinearLayoutCompat mainLinearLayout;
        @BindView(R.id.mainImageView)
        AppCompatImageView mainImageView;
        @BindView(R.id.nameTextView)
        AppCompatTextView nameTextView;

        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
